package io.adrainty.bolee.insurance.handler;

import io.adrainty.bolee.insurance.models.aggregate.EarningResultDTO;
import io.adrainty.bolee.insurance.models.entity.CustomerRelationEntity;
import io.adrainty.bolee.insurance.models.entity.WarrantyEntity;
import io.adrainty.bolee.insurance.models.entity.WarrantyOrderEntity;
import io.adrainty.bolee.insurance.models.request.DoInsuranceDTO;
import io.adrainty.bolee.insurance.models.valobj.CheckRuleEnum;

import java.util.List;

/**
 * @author AdRainty
 * @version V1.0.0
 * @since 2025/8/24 下午10:38
 */
public interface InsuranceHandler {

    /**
     * 试算
     *
     * @param doInsureVo 试算参数
     * @return 试算结果
     */
    String doPremium(DoInsuranceDTO doInsureVo);

    /**
     * 支持的保险类型
     *
     * @return CheckRuleEnum
     */
    CheckRuleEnum supportCheckRule();

    /**
     * 试算收益
     *
     * @param doInsuranceDTO 试算参数
     * @return 试算结果
     */
    EarningResultDTO doEarnings(DoInsuranceDTO doInsuranceDTO);

    /**
     * 购买保险
     *
     * @param doInsuranceDTO 购买参数
     * @return 保单信息
     */
    WarrantyEntity doInsure(DoInsuranceDTO doInsuranceDTO);

    /**
     * 构建被保人
     *
     * @param customerRelationIds 被保人id
     * @return 被保人信息
     */
    List<CustomerRelationEntity> buildCustomerRelationList(List<String> customerRelationIds);

    /**
     * 创建保单订单
     *
     * @param warrantyEntity 保单信息
     * @return 保单订单信息
     */
    List<WarrantyOrderEntity> createWarrantyOrder(WarrantyEntity warrantyEntity);
}
